import request from '@/utils/request'

/**
 * APS排产结果相关API
 */
export const apsSchedulingResultApi = {
  /**
   * 查询排产方案
   * @param {string} schedulingId - 排产ID
   * @returns {Promise} 返回排产方案列表
   */
  querySchedulingResults: (schedulingId) => {
    return request.post('/aps-scheduling-results/query-scheduling-results', null, {
      params: { schedulingId }
    })
  },

  /**
   * 选择排产方案
   * @param {string} plan - 排产方案
   * @param {string} planIndex - 排产方案序号
   * @returns {Promise} 返回选择结果
   */
  selectSchedulingPlan: (plan, planIndex) => {
    return request.post('/aps-scheduling-results/select-scheduling-plan', null, {
      params: { plan, planIndex }
    })
  },

  /**
   * 查询甘特图
   * @param {Object} parameter - 甘特图参数对象
   * @returns {Promise} 返回甘特图数据
   */
  queryGanttChart: (parameter) => {
    return request.post('/aps-scheduling-results/query-gantt-chart', parameter)
  }
}

export default apsSchedulingResultApi

